@import "../../themes/ionic.globals.ios";

// iOS Picker
// --------------------------------------------------

$picker-ios-height:                            260px !default;
$picker-ios-border-color:                      $list-ios-border-color !default;
$picker-ios-background-color:                  $list-ios-background-color !default;

$picker-ios-toolbar-height:                    44px !default;
$picker-ios-toolbar-background-color:          $picker-ios-background-color !default;

$picker-ios-button-height:                     $picker-ios-toolbar-height !default;
$picker-ios-button-text-color:                 color($colors-ios, primary) !default;
$picker-ios-button-background-color:           transparent !default;

$picker-ios-column-padding:                    0 4px !default;
$picker-ios-column-perspective:                1000px !default;

$picker-ios-option-padding:                    0 !default;
$picker-ios-option-text-color:                 $list-ios-text-color !default;
$picker-ios-option-font-size:                  20px !default;
$picker-ios-option-height:                     42px !default;
$picker-ios-option-offset-y:                   (($picker-ios-height - $picker-ios-toolbar-height) / 2) - ($picker-ios-option-height / 2) - 10 !default;


.picker-ios .picker-wrapper {
  height: $picker-ios-height;

  border-top: 1px solid $picker-ios-border-color;

  background: $picker-ios-background-color;
}

.picker-ios .picker-toolbar {
  display: flex;

  height: $picker-ios-toolbar-height;

  border-bottom: $hairlines-width solid $picker-ios-border-color;

  background: $picker-ios-toolbar-background-color;
}

.picker-ios .picker-toolbar-button {
  flex: 1;

  text-align: right;
}

.picker-ios .picker-toolbar-cancel {
  font-weight: normal;

  text-align: left;
}

.picker-ios .picker-button,
.picker-ios .picker-button.activated {
  margin: 0;

  height: $picker-ios-button-height;

  color: $picker-ios-button-text-color;
  background: $picker-ios-button-background-color;
}

.picker-columns {
  height: $picker-ios-height - $picker-ios-toolbar-height;

  perspective: $picker-ios-column-perspective;
}

.picker-ios .picker-col {
  padding: $picker-ios-column-padding;

  transform-style: preserve-3d;
}

.picker-ios .picker-prefix,
.picker-ios .picker-suffix,
.picker-ios .picker-opts {
  top: $picker-ios-option-offset-y;

  font-size: $picker-ios-option-font-size;
  line-height: $picker-ios-option-height;
  color: $picker-ios-option-text-color;

  transform-style: preserve-3d;

  pointer-events: none;
}

.picker-ios .picker-opt {
  margin: 0;
  padding: $picker-ios-option-padding;

  height: 4.6rem;

  font-size: $picker-ios-option-font-size;
  line-height: $picker-ios-option-height;

  background: transparent;
  transform-origin: center center;
  transform-style: preserve-3d;
  transition-timing-function: ease-out;

  backface-visibility: hidden;

  pointer-events: auto;
}

.picker-ios .picker-above-highlight {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
  display: block;

  width: 100%;
  height: $picker-ios-option-offset-y + 4px;

  border-bottom: 1px solid $picker-ios-border-color;

  background: linear-gradient(to bottom,
                            rgba($picker-ios-background-color, 1) 20%,
                            rgba($picker-ios-background-color, .7) 100%);

  transform: translate3d(0, 0, 90px);
}

.picker-ios .picker-below-highlight {
  position: absolute;
  top: $picker-ios-option-offset-y + $picker-ios-option-height - 4;
  left: 0;
  z-index: 11;
  display: block;

  width: 100%;
  height: $picker-ios-option-offset-y + $picker-ios-option-height;

  border-top: 1px solid $picker-ios-border-color;

  background: linear-gradient(to top,
                           rgba($picker-ios-background-color, 1) 30%,
                           rgba($picker-ios-background-color, .7) 100%);

  transform: translate3d(0, 0, 90px);
}
